//
//  WPDisButton.m
//  MyLottery
//
//  Created by wpapple on 16/5/25.
//  Copyright © 2016年 wpapple. All rights reserved.
//

#import "WPDisButton.h"

@implementation WPDisButton

- (instancetype)initWithCoder:(NSCoder *)coder
{
    self = [super initWithCoder:coder];
    if (self) {
        self.imageView.contentMode = UIViewContentModeCenter;
    }
    return self;
}

-(CGRect)titleRectForContentRect:(CGRect)contentRect
{
    CGFloat w = self.width;
    CGFloat x = 0;
    CGFloat y = 0;
    CGFloat height = self.height;
    CGFloat weidht =  w;
    
    return CGRectMake(x, y, weidht, height);
}

-(CGRect)imageRectForContentRect:(CGRect)contentRect
{
    CGFloat w = self.width;
    CGFloat x = 0.8 * w;
    CGFloat y = 0;
    CGFloat width = 0.2 * w;
    CGFloat height = self.height;
    
    return CGRectMake(x, y, width, height);
}

@end
